<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网站运行状态统计</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            line-height: 1.6;
        }

        .container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-width: 700px;
            width: 100%;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .header {
            text-align: center;
            margin-bottom: 40px;
        }

        h1 {
            color: #2d3748;
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            padding: 25px;
            border-radius: 15px;
            border: 1px solid #e2e8f0;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }


        .stat-icon {
            font-size: 2rem;
            margin-bottom: 15px;
            display: block;
        }

        .stat-label {
            color: #4a5568;
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-value {
            color: #2d3748;
            font-size: 1.8rem;
            font-weight: 700;
            display: block;
        }

        .uptime-value {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .success-value {
            color: #22543d;
        }

        .error-value {
            color: #c53030;
        }

        .not-found-value {
            color: #dd6b20;
        }

        .rate-value {
            color: #2b6cb0;
        }

        .total-value {
            color: #553c9a;
        }

        .chart-container {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            padding: 25px;
            border-radius: 15px;
            border: 1px solid #e2e8f0;
            margin-bottom: 30px;
        }

        .chart-title {
            color: #2d3748;
            font-weight: 600;
            margin-bottom: 20px;
            text-align: center;
            font-size: 1.2rem;
        }

        .progress-bar {
            background: #e2e8f0;
            height: 20px;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
            border-radius: 10px;
            transition: width 0.3s ease;
        }

        .progress-label {
            text-align: center;
            color: #4a5568;
            font-size: 0.9rem;
            margin-top: 5px;
        }

        .nav-links {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid #e2e8f0;
        }

        .nav-links a {
            color: #667eea;
            text-decoration: none;
            margin: 0 15px;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .nav-links a:hover {
            color: #764ba2;
            text-decoration: none;
        }

        .refresh-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
            margin: 0 auto 30px;
            display: block;
        }

        .refresh-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }

        @media (max-width: 768px) {
            .container {
                padding: 30px 20px;
            }

            h1 {
                font-size: 2rem;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .stat-value {
                font-size: 1.5rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>网站运行状态统计</h1>
        </div>

        <button class="refresh-btn" onclick="location.reload()">
            🔄 刷新数据
        </button>

        <div class="stats-grid">
            <div class="stat-card">
                <span class="stat-icon">⏱️</span>
                <div class="stat-label">运行时间</div>
                <div class="stat-value uptime-value">{{.Uptime}}</div>
            </div>

            <div class="stat-card">
                <span class="stat-icon">🌐</span>
                <div class="stat-label">总请求数</div>
                <div class="stat-value total-value">{{.TotalRequests}}</div>
            </div>

            <div class="stat-card">
                <span class="stat-icon">✅</span>
                <div class="stat-label">成功响应</div>
                <div class="stat-value success-value">{{.SuccessCount}}</div>
            </div>

            <div class="stat-card">
                <span class="stat-icon">❌</span>
                <div class="stat-label">错误响应</div>
                <div class="stat-value error-value">{{.ErrorCount}}</div>
            </div>

            <div class="stat-card">
                <span class="stat-icon">🔍</span>
                <div class="stat-label">404 响应</div>
                <div class="stat-value not-found-value">{{.NotFoundCount}}</div>
            </div>

            <div class="stat-card">
                <span class="stat-icon">📈</span>
                <div class="stat-label">成功率</div>
                <div class="stat-value rate-value">{{printf "%.2f" .SuccessRate}}%</div>
            </div>
        </div>

        <div class="nav-links">
            <a href="/gsws-about">ℹ️ 关于 GSWS</a>
            <a href="/">🏠 返回首页</a>
        </div>
    </div>

    <script>
        // 添加自动刷新功能
        setTimeout(function() {
            location.reload();
        }, 30000); // 30秒后自动刷新
    </script>
</body>
</html>